package com.clss.commandhelper.tools.janus.util;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;
import java.util.UUID;

/**
* 
*/
public class ChatMessage implements Serializable{
	private String sender;//id
	private String from;//发送人昵称
	private String text;//消息
	private Set<UUID> receiver;//接收者

	private Date time;//时间

    
    public ChatMessage() {
		super();
	;
	}

	public ChatMessage(String from,String sender,  String text, Date time) {
    	super();
    	this.from = from;
    	this.sender = sender;
    	this.text = text;
    	this.time = time;
    }
	
	public ChatMessage(String from, String text, Date time) {
		super();
		this.from = from;
		this.text = text;
		this.time = time;
	}


	public String getSender() {
		return sender;
	}
	public void setSender(String sender) {
		this.sender = sender;
	}
	public String getFrom() {
		return from;
	}
	public void setFrom(String from) {
		this.from = from;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public Set<UUID> getReceiver() {
		return receiver;
	}
	public void setReceiver(Set<UUID> receiver) {
		this.receiver = receiver;
	}
	public Date getTime() {
		return time;
	}
	public void setTime(Date time) {
		this.time = time;
	}
	@Override
    public int hashCode() {
        return (this.from + this.text + this.time).hashCode();
    }

	@Override
	public String toString() {
		return "ChatMessage{" +
				"sender='" + sender + '\'' +
				", from='" + from + '\'' +
				", text='" + text + '\'' +
				", receiver=" + receiver +
				", time=" + time +
				'}';
	}
}
